package top.wjgyy.tools.ddns.model;

import com.aliyuncs.alidns.model.v20150109.DescribeDomainRecordsResponse;
import com.aliyuncs.domain.model.v20180129.QueryDomainListResponse;
import javafx.beans.property.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import top.wjgyy.tools.ddns.enums.AliConstants;

import java.util.List;

public class IndexModel {
    private StringProperty accessKeyId = new SimpleStringProperty();
    private StringProperty secret = new SimpleStringProperty();
    private StringProperty ipv4 = new SimpleStringProperty();
    private StringProperty ipv6 = new SimpleStringProperty();
    private StringProperty recordsAdrressValue = new SimpleStringProperty();
    private BooleanProperty isShow = new SimpleBooleanProperty(false);
    private BooleanProperty minimize = new SimpleBooleanProperty(false);
    private ObservableList<String> historyValue = FXCollections.observableArrayList();
    //域名选中值
    private ObjectProperty<QueryDomainListResponse.Domain> domainComboValue = new SimpleObjectProperty<>();
    //域名解析选中值
    private ObjectProperty<DescribeDomainRecordsResponse.Record> domainRecordsComboValue = new SimpleObjectProperty<>();
    private ObjectProperty<AliConstants> domainTypeComboValue = new SimpleObjectProperty<>();

    public String getAccessKeyId() {
        return accessKeyId.get();
    }

    public StringProperty accessKeyIdProperty() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId.set(accessKeyId);
    }

    public String getSecret() {
        return secret.get();
    }

    public StringProperty secretProperty() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret.set(secret);
    }

    public String getIpv4() {
        return ipv4.get();
    }

    public StringProperty ipv4Property() {
        return ipv4;
    }

    public void setIpv4(String ipv4) {
        this.ipv4.set(ipv4);
    }

    public String getIpv6() {
        return ipv6.get();
    }

    public StringProperty ipv6Property() {
        return ipv6;
    }

    public void setIpv6(String ipv6) {
        this.ipv6.set(ipv6);
    }

    public String getRecordsAdrressValue() {
        return recordsAdrressValue.get();
    }

    public StringProperty recordsAdrressValueProperty() {
        return recordsAdrressValue;
    }

    public void setRecordsAdrressValue(String recordsAdrressValue) {
        this.recordsAdrressValue.set(recordsAdrressValue);
    }

    public boolean isIsShow() {
        return isShow.get();
    }

    public BooleanProperty isShowProperty() {
        return isShow;
    }

    public void setIsShow(boolean isShow) {
        this.isShow.set(isShow);
    }

    public boolean isMinimize() {
        return minimize.get();
    }

    public BooleanProperty minimizeProperty() {
        return minimize;
    }

    public void setMinimize(boolean minimize) {
        this.minimize.set(minimize);
    }

    public ObservableList getHistoryValue() {
        return historyValue;
    }

    public void setHistoryValue(List<String> historyValue) {
        this.historyValue.addAll(historyValue);
    }
    public void addHistoryValue(String... historyValue) {
        this.historyValue.addAll(historyValue);
    }

    public QueryDomainListResponse.Domain getDomainComboValue() {
        return domainComboValue.get();
    }

    public ObjectProperty<QueryDomainListResponse.Domain> domainComboValueProperty() {
        return domainComboValue;
    }

    public void setDomainComboValue(QueryDomainListResponse.Domain domainComboValue) {
        this.domainComboValue.set(domainComboValue);
    }

    public DescribeDomainRecordsResponse.Record getDomainRecordsComboValue() {
        return domainRecordsComboValue.get();
    }

    public ObjectProperty<DescribeDomainRecordsResponse.Record> domainRecordsComboValueProperty() {
        return domainRecordsComboValue;
    }

    public void setDomainRecordsComboValue(DescribeDomainRecordsResponse.Record domainRecordsComboValue) {
        this.domainRecordsComboValue.set(domainRecordsComboValue);
    }

    public AliConstants getDomainTypeComboValue() {
        return domainTypeComboValue.get();
    }

    public ObjectProperty<AliConstants> domainTypeComboValueProperty() {
        return domainTypeComboValue;
    }

    public void setDomainTypeComboValue(AliConstants domainTypeComboValue) {
        this.domainTypeComboValue.set(domainTypeComboValue);
    }
}
